package com.newsproject.controller;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.newsproject.service.GetAnnouncementService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;

@Api(tags = "获取通知")
@RestController
@RequestMapping("/GetAnnouncementController")
public class GetAnnouncementController {

    @Autowired
    GetAnnouncementService getAnnouncementService;

    @ApiOperation(value = "获取新增通知信息的个数", notes = "获取新增通知信息的个数")
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功"),
            @ApiResponse(code = 400, message = "请求参数错误"),
            @ApiResponse(code = 500, message = "服务器内部错误")
    })
    @GetMapping("/count")
    public int getAnnouncementCount(HttpSession session) {
        return getAnnouncementService.getAnnouncementCount(session);
    }
}